package com.huawei.appgallery.assistantdock.gamemode.card;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import com.huawei.appgallery.assistantdock.base.cardkit.card.BuoyBaseCard;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import huawei.widget.HwTextView;
import java.util.LinkedHashMap;
import o.beo$e;
import o.beq;
import o.cgz;
import o.dgh;
import o.Logger;
import o.ll;

public abstract class BuoyBaseEnterCard extends BuoyBaseCard implements OnClickListener {
    protected ImageView ʼ;
    protected HwTextView ˊ;
    protected boolean ˋ = false;
    protected boolean ˎ = true;
    protected boolean ˏ = false;
    boolean ॱ = false;
    protected ImageView ॱॱ;
    private String ᐝ;

    protected abstract String ᐝ();

    public BuoyBaseEnterCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ˊ = (HwTextView) view.findViewById(beo$e.ॱͺ);
        this.ʼ = (ImageView) view.findViewById(beo$e.ͺॱ);
        this.ॱॱ = (ImageView) view.findViewById(beo$e.ˊॱ);
        view.setOnClickListener(this);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        ˊ();
    }

    public void ˎ(boolean z) {
        this.ˏ = z;
    }

    public void ˏ(boolean z) {
        this.ˋ = z;
    }

    protected void ˊ() {
        float f;
        float f2 = 0.3f;
        Object obj = (!this.ˎ || (this.ˏ && this.ˋ)) ? 1 : null;
        HwTextView hwTextView = this.ˊ;
        if (obj != null) {
            f = 0.3f;
        } else {
            f = 1.0f;
        }
        hwTextView.setAlpha(f);
        ImageView imageView = this.ʼ;
        if (obj == null) {
            f2 = 1.0f;
        }
        imageView.setAlpha(f2);
        if (this.ˏ || !this.ˎ) {
            ʼ();
        }
    }

    protected void ˏ(String str) {
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("func_uri", ᐝ());
        linkedHashMap.put("func_type", "2");
        linkedHashMap.put("func_value", str);
        linkedHashMap.put("mode", this.ᐝ);
        linkedHashMap.put("service_type", String.valueOf(4));
        linkedHashMap.put("package_name", beq.ˎ());
        dgh.ˋ("action_buoy_service", linkedHashMap);
    }

    void ॱॱ() {
    }

    public void onClick(View view) {
        if (this.ˏ || !this.ˎ) {
            Logger.ˎ("BuoyBaseEnterCard", "is not enable");
        } else {
            ˋ();
        }
    }

    protected void ˋ() {
    }

    void ʻ() {
        Intent intent = new Intent();
        intent.setAction("com.huawei.appmarket.refreshservicewindow");
        ll.ˏ(this.ʼॱ.getApplicationContext()).ˋ(intent);
    }

    public void ˋ(boolean z) {
        this.ˎ = z;
    }

    public void ˎ(String str) {
        this.ᐝ = str;
    }

    public void ʼ() {
        if (this.ॱॱ != null) {
            this.ॱॱ.setVisibility(8);
        }
    }

    public void ʽ() {
        if (this.ॱॱ != null) {
            this.ॱॱ.setVisibility(0);
        }
    }
}
